bitkeeper revision 1.1236.34.12 (42398f7asEUKTar-hO4ZiDXWYTpyiA)
authorkaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk>
Thu, 17 Mar 2005 14:08:58 +0000 (14:08 +0000)
committerkaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk>
Thu, 17 Mar 2005 14:08:58 +0000 (14:08 +0000)
Some small header-include cleanups. No need for BIGLOCK in dom_mem_op
hypercall.
Signed-off-by: Keir Fraser <keir@xensource.com>
xen/arch/x86/smp.c
xen/arch/x86/x86_emulate.c
xen/common/dom_mem_ops.c
xen/common/elf.c
xen/common/page_alloc.c
xen/common/xmalloc.c
xen/include/asm-x86/mm.h
xen/include/xen/sched.h

index 65b126c1e9270b5310947bdd52479396d47101d0..a56b85827ce470bb3844e92b504a3e9db0ae3064 100644 (file)
@@ -8,9 +8,11 @@
  *     later.
  */
 
+#include <xen/config.h>
 #include <xen/irq.h>
 #include <xen/sched.h>
 #include <xen/delay.h>
+#include <xen/perfc.h>
 #include <xen/spinlock.h>
 #include <asm/smp.h>
 #include <asm/mc146818rtc.h>
@@ -18,8 +20,6 @@
 #include <asm/smpboot.h>
 #include <asm/hardirq.h>
 
-#ifdef CONFIG_SMP
-
 /*
  *     Some notes on x86 processor bugs affecting SMP operation:
  *
@@ -420,5 +420,3 @@ asmlinkage void smp_call_function_interrupt(void)
         atomic_inc(&call_data->finished);
     }
 }
-
-#endif /* CONFIG_SMP */
index fc1ad10122aa309f8a73c10c8bbd313b98eefd5a..7b959590f90d52b0b4bf72e4b14f2e6f7cb10109 100644 (file)
@@ -22,6 +22,7 @@ typedef int64_t            s64;
 #include <xen/config.h>
 #include <xen/types.h>
 #include <xen/lib.h>
+#include <xen/mm.h>
 #include <asm/regs.h>
 #endif
 #include <asm-x86/x86_emulate.h>
index 5d761d84dcbdf93a6b617d5cd502d8e65e332e47..8547dcf70175ac7ca12c6a3e7f91f1c8a642dee0 100644 (file)
@@ -142,8 +142,6 @@ do_dom_mem_op(unsigned long  op,
     else if ( unlikely((d = find_domain_by_id(domid)) == NULL) )
         return -ESRCH;
 
-    LOCK_BIGLOCK(d);
-
     switch ( op )
     {
     case MEMOP_increase_reservation:
@@ -162,8 +160,6 @@ do_dom_mem_op(unsigned long  op,
     if ( unlikely(domid != DOMID_SELF) )
         put_domain(d);
 
-    UNLOCK_BIGLOCK(d);
-
     return rc;
 }
 
index 90e831d78a361fba52a243c6bc45ebd17ff86d69..74f1609392ff7671d688981fb1fd4138b66055e7 100644 (file)
@@ -9,6 +9,7 @@
 #include <xen/lib.h>
 #include <xen/mm.h>
 #include <xen/elf.h>
+#include <xen/sched.h>
 
 #ifdef CONFIG_X86
 #define FORCE_XENELF_IMAGE 1
index 90c122310e5ac9bcaa247724db03a61860c598e6..b23733255835a19794164935c1737ba4a9d43da7 100644 (file)
 #include <xen/init.h>
 #include <xen/types.h>
 #include <xen/lib.h>
-#include <asm/page.h>
+#include <xen/perfc.h>
 #include <xen/spinlock.h>
 #include <xen/slab.h>
 #include <xen/irq.h>
 #include <asm/domain_page.h>
+#include <asm/page.h>
 
 /*
  * Comma-separated list of hexadecimal page numbers containing bad bytes.
index a3ebc0c778a4d73d9dbefa5067d235c073d558d8..bb90cc392da11bc2ec08092922454992c72df449 100644 (file)
  *     (Disadvantage is potentially greater internal fragmentation).
  */
 
+#include <xen/config.h>
 #include <xen/mm.h>
 #include <xen/spinlock.h>
 #include <xen/ac_timer.h>
 #include <xen/cache.h>
+#include <xen/prefetch.h>
 
 static LIST_HEAD(freelist);
 static spinlock_t freelist_lock = SPIN_LOCK_UNLOCKED;
index 8ba43abc69b718f7eb68f9c34e639196d748bbd7..d2d68e7cc28da8ea0ac6f0f6166f66b01e72a2a7 100644 (file)
@@ -4,18 +4,7 @@
 
 #include <xen/config.h>
 #include <xen/list.h>
-#include <xen/spinlock.h>
-#include <xen/perfc.h>
-#include <xen/sched.h>
-
-#include <asm/processor.h>
-#include <asm/atomic.h>
-#include <asm/desc.h>
-#include <asm/flushtlb.h>
 #include <asm/io.h>
-#include <asm/uaccess.h>
-
-#include <public/xen.h>
 
 /*
  * Per-page-frame information.
@@ -241,19 +230,11 @@ void synchronise_pagetables(unsigned long cpu_mask);
  */
 #define __phys_to_machine_mapping ((unsigned long *)RO_MPT_VIRT_START)
 
-/* Returns the machine physical */
-static inline unsigned long phys_to_machine_mapping(unsigned long pfn) 
-{
-    unsigned long mfn;
-    l1_pgentry_t pte;
-
-   if (__get_user(l1_pgentry_val(pte), (__phys_to_machine_mapping + pfn)))
-       mfn = 0;
-   else
-       mfn = l1_pgentry_to_phys(pte) >> PAGE_SHIFT;
-
-   return mfn; 
-}
+#define phys_to_machine_mapping(_pfn)                                      \
+({ l1_pgentry_t l1e; unsigned long mfn;                                    \
+   mfn = __get_user(l1_pgentry_val(l1e), &__phys_to_machine_mapping[_pfn]) \
+       ? 0 : l1_pgentry_to_pfn(l1e);                                       \
+   mfn; })
 #define set_machinetophys(_mfn, _pfn) machine_to_phys_mapping[(_mfn)] = (_pfn)
 
 #define DEFAULT_GDT_ENTRIES     (LAST_RESERVED_GDT_ENTRY+1)
@@ -339,9 +320,10 @@ void audit_domains(void);
 
 void propagate_page_fault(unsigned long addr, u16 error_code);
 
-/* update_grant_va_mapping
- * Caller must own d's BIGLOCK, is responsible for flushing the TLB,
- * and have already get_page'd */
+/*
+ * Caller must own d's BIGLOCK, is responsible for flushing the TLB, and must 
+ * hold a reference to the page.
+ */
 int update_grant_va_mapping(unsigned long va,
                             unsigned long val,
                             struct domain *d,
index e240ea6f31188d7c1bb1ef02fa570fa10f101bda..44f24831e86d8ff0fdec316422ed14fdd6a1b38c 100644 (file)
@@ -89,19 +89,9 @@ struct exec_domain
     struct arch_exec_domain arch;
 };
 
-/*
-** SMH: do_mmu_update() grabs big_lock and subsequently can fault 
-** on map_ldt_shadow_page(), enter do_page_fault() and then deadlock 
-** trying to reacquire big_lock. A temporary fix is to make big_lock
-** recursive; overall probably needs more thought. 
-*/
-#if 0
-#define LOCK_BIGLOCK(_d) spin_lock(&(_d)->big_lock)
-#define UNLOCK_BIGLOCK(_d) spin_unlock(&(_d)->big_lock)
-#else
+/* Per-domain lock can be recursively acquired in fault handlers. */
 #define LOCK_BIGLOCK(_d) spin_lock_recursive(&(_d)->big_lock)
 #define UNLOCK_BIGLOCK(_d) spin_unlock_recursive(&(_d)->big_lock)
-#endif
 
 struct domain
 {